<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
 <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

<body>
    <button id="generate-chart-btn">生成图片</button>
    <img id="image-chart" src="" alt="Image Chart">
    <script>
        $(document).ready(function () {
            $('#generate-chart-btn').click(function () {
                $.ajax({
                    url: 'http://127.0.0.1:5000/generate_image_chart',
                    method: 'GET',
                    success: function (response) {
                        let timestamp = new Date().getTime();
                        $('#image-chart').attr('src', '/images/image_chart.png?' + timestamp);
                    },
                    error: function (error) {
                        console.log(error);
                    }
                });
            });
        });
    </script>
</body>

</html>

</html>